import java.util.Scanner;

public class dier {

        public static void main1(String[] args) {
            int ac = 1;
            int bd = 0;
            try{
                System.out.println(ac/bd);
            }catch(ArithmeticException e){
                System.out.println("除数不能为0！");
            }
        }

        public static void main2(String[] args) {
            float xz = 1.0f;
            float yl= 0.0f;
            System.out.println(xz/yl);
        }

        public static void main3(String[] args) {
            Scanner scan = new Scanner(System.in);
            System.out.println("请输入两个数");
            int a = scan.nextInt();
            int b = scan.nextInt();
            try{
                System.out.println(a/b);
            }catch(ArithmeticException e){
                System.out.println("除数不能为0");
            }
        }

        public static void main(String[] args) {
            int[] a = new int[3];
            int bw = 0;
            for (int i = 0; i < a.length; i++) {
                a[i] = i;
            }
            try{
                int temp = a[4]/bw;
                System.out.println("下标为1的元素修改后结果为："+temp);
            }catch(ArithmeticException e){
                System.out.println("除数不能为0！");
            }catch(ArrayIndexOutOfBoundsException e){
                System.out.println("被除数下标超过了数组元素个数");
            }


            System.out.println("程序执行结束！");
        }
    }

